package com.songlanyun.modules.workPolicy.entity;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.songlanyun.common.drive.RootEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("yxt_work_policy")
public class WorkPolicy extends RootEntity<Integer, WorkPolicy> implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId
    private Integer id;

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空")
    private String header;

    /**
     * 缩略图
     */
    @NotBlank(message = "缩略图不能为空")
    private String thumbnail;

    /**
     * 序号
     */
//    @NotNull(message = "优先级不能为空")
    private Integer sort;

    /**
     * 内容
     */
    @NotBlank(message = "内容不能为空")
    private String content;

    /**
     * 是否显示
     */
    @NotNull(message = "是否显示不能为空")
    private Boolean isShow;

    /**
     *
     */
    private Long createBy;
    /**
     * 发布者
     */
    @TableField(exist = false)
    private String publisher;
    /**
     *
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     *
     */
    private Long updateBy;
    /**
     *
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Override
    public Integer getIdentity() {
        return getId();
    }
}
